import requests

# 请将 {userId} 替换为实际的用户ID
user_id = "your_user_id_here"
url = f"http://118.195.178.46:8005/chat/session/{user_id}"

try:
    response = requests.get(url)
    response.raise_for_status()  # 如果响应状态码不是200，引发HTTPError异常
    print(response.json())  # 如果接口返回的是JSON数据，解析并打印
except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err}")
except requests.exceptions.ConnectionError as conn_err:
    print(f"Connection error occurred: {conn_err}")
except requests.exceptions.Timeout as timeout_err:
    print(f"Timeout error occurred: {timeout_err}")
except requests.exceptions.RequestException as req_err:
    print(f"An error occurred: {req_err}")